package com.itheima.homework;

import java.util.Scanner;

public class TestDemo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String username = "panghu";
        String password = "www.jian";


        for (int i = 2; i >= 0; i--) {
            System.out.println("请输入用户名:");
            String scUername = sc.nextLine();
            System.out.println("请输入用户密码");
            String scPassword = sc.nextLine();
            if (username.equals(scUername) && password.equals(scPassword)) {
                System.out.println("登录成功");
                break;

            } else {
                if (i == 0) {
                    System.out.println("今日次数用完请明天再来");
                } else {
                    System.out.println("用户名或密码输入错误还有" + i + "次机会");
                }
            }

        }

    }
}
